﻿using System;
using System.Runtime.Serialization;

namespace LuxDiner.Model.Members
{
    [DataContract]
    public class CustomerModel : MBase
    {
        [Model(ConvertType = AttributeType.IgnoreUpdate)]
        [DataMember]
        public int ID { get; set; }
        [Model]
        [DataMember]
        public string Corporation { get; set; }
        [Model]
        [DataMember]
        public string RealName { get; set; }
        [Model]
        [DataMember]
        public string Address { get; set; }
        [Model]
        [DataMember]
        public string Mobile { get; set; }
        [Model]
        [DataMember]
        public int CType { get; set; }
        [Model]
        [DataMember]
        public string Pinyin { get; set; }
        [Model]
        [DataMember]
        public int SortIndex { get; set; }
        [Model]
        [DataMember]
        public int Status { get; set; }
        [Model]
        [DataMember]
        public string CustomerNo { get; set; }
        #region Help
        [DataMember]
        public CustomerCategoryCollection Categories { get; set; }
        [DataMember]
        public string ComplexName
        {
            get
            {
                return string.Format("{0}【{1}】 {2}", Corporation, RealName, Mobile);
            }
        }
        [DataMember]
        public string PinYinAndMobile
        {
            get
            {
                return string.Format("{0}{1}", Pinyin, Mobile);
            }
        }
        #endregion
    }
    [DataContract]
    public class CustomerCollection : ModelCollectionBase<CustomerModel> { }
}
